-
Notifications
You must be signed in to change notification settings - Fork 412
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add extra info for misc column for fueled boosters (cap, shield, and armor) #960
Add extra info for misc column for fueled boosters (cap, shield, and armor) #960
Conversation
Instead of |
Also
I had no idea this was a syntax that worked... TIL |
Catches if there's an attribute error. Useful when we try and get an attribute when the object doesn't even have it.
This reverts commit f111c49.
Useful for when we try to get an sub-attribute on an object where the attribute doesn't exist. Now returns the default value.
There is some weirdness with it. If you try:
I did a bunch of testing against both
You're right, we should use getModifiedItemAttr. And you've probably noticed, but now Just makes sense to me, but if you see issue with it.... I also cleaned up the logic. It was a bit messy before I wedged the extra logic in there, and was downright painful afterwards. Hopefully this is cleaner. . @blitzmann this should be ready to be merged. |
Not within the context of discussion, but i think that It works like: in case of "and" it evaluates 1st expression, if it's evaluated as True - evaluates 2nd, and so on. First seen expression evaluated as False will be returned, or last expression. Similar for "or" - if first expression is evaluated as False, 2nd will be evaluated. First seen expression evaluated as True will be returned, or last expression.
There're some applications for this logic, e.g. when you care about performance:
In this case, if
|
@DarkFenX: thanks for the clarification :) We should tweak the code to explicitly check for these to avoid problems. @Ebag333: I am reluctant to modify the Can you give me an instance to reproduce the AttributeError? Did you happen to dig deeper to figure out why it was happening? |
Yeah, playing with it further it doesn't always do what you would expect it to. Changed it to be explicit.
I can understand your reluctance, but it really shouldn't break anything. Anything that was expecting a None will still get a None returned (since Things that use it like: There's also a potential issue with that statement.
If the attribute is legitimately a 0, then it will return the There are dozens if not hundreds of attributes that have a 0 value in the database (37948 to be precise). I can't even begin to tell you how many of those attributes would be used by the code, we might never run into it. But it is a potential issue, and I don't like having scenarios where we can return the wrong value. As for reproducing the Either way it shouldn't hurt anything having the try/catch. Since for this usage /me edits
Sorry to quote myself, but I actually lied. A quick regex query shows we use For the most part, I don't see any scenarios where we run into the situation described above (can't think of a scenario where the attribute would be set to 0 for those particular attributes). It's still a trap that a future dev could fall into, and a particularly subtle one that wouldn't be easily detected. |
The cases in which we do I am still not sure why the I'm going to merge this in but revert the |
Adds the ability to show info for capacitor boosters and remote ancil armor/shield reppers, in addition to the existing local ancil armor/shield reppers.
shows the reload time to make it more clear the span that the total amount of reps lasts.
Added to tooltip the number of charges used, and the amount of time for 5, 10, and 25 cycles of the booster (1 cycle is using all charges + reload time).
A picture is worth a thousand words, so this gif is probably a small novel.
https://puu.sh/tEU9L/bd88811fc9.gif
See #959 for history.